<?php

require_once "includes/user_functions.php";

function make_button($b_label,$b_url)
{
	
	echo "<a href=\"".$b_url."\">";
	echo "<span class=\"button\">";	
	echo $b_label;
	echo "</span>";	
	echo "</a> ";
	
}

function render_header($page)
{
// Output doctype and HTML header:
	echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
	echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
	echo "<head>\n";
	echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n";
	echo "<title>".OH_TITLE." - ".$page."</title>\n";
	echo "<link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
	echo "<link rel=\"shortcut icon\" href=\"".OH_LOGO."\">";
	echo "</head>\n";
	echo "<body>\n";
	
	echo "<div>";
	echo "<div class=\"logo\"><img src=\"".OH_LOGO."\" height=\"100\"></div>\n";

	echo "<div class=\"header\">\n";
	echo "<span class=\"bigtext\">".OH_TITLE."</span>";
	if(oh_is_logged_in())	
	{
		echo " &mdash; Welcome ".$_SESSION['realname'].".";
	}
//	echo "<br /><span class=\"smalltext\">".$_SESSION['user_login'].$_SESSION['user_name'].$_SESSION['user_id'].$_SESSION['cleared'].$_SESSION['user_isadmin'].$_SESSION['expires'].$_SESSION['realname']."</span>";

	echo "<br \>";

	echo "<div class=\"buttonrow\">";
	make_button("About","index.php");
	make_button("Game Schedule","signup.php");
	if(oh_is_logged_in())
	{
		make_button("My Schedule","schedule.php");
		make_button("Settings","settings.php");
		make_button("Logout","logout.php");
	}
	else 
	{
		make_button("Login","login.php");
		make_button("Register","register.php");
	}
	echo "</div>";

	//echo "<br \>";

	if(oh_is_admin())
	{
		echo "<div class=\"buttonrow\">";
		make_button("Global Settings","global.php");
		make_button("Slots","slots.php");
		make_button("Scenarios","scenarios.php");
		make_button("Games","games.php");
		make_button("Players","players.php");
		echo "</div>";
	}
	echo "</div>\n";
	
	echo "</div>\n";
	
	echo "<div class=\"bodydiv\">\n";

//	echo "<hr />\n";
	
	
}

function render_footer()
{
	echo "</div>";

	echo "\n</body>";
}
?>